package com.ibeeking.found.common.enums.marketing;

/**
 * @Author ibeeking
 * @Date: 2021-01-05 19:15
 * @Description: 券类型枚举
 */
public enum ReceiverEnum {
    /**
     * 券类型枚举
     */
    NON_LIMIT(1, "不限制"),
    LEVEL_LIMIT(2, "指定等级"),
    TAGS_LIMIT(3, "指定标签"),
    ;

    private Integer code;
    private String lable;

    ReceiverEnum(Integer code, String lable) {
        this.code = code;
        this.lable = lable;
    }

    public Integer getCode() {
        return code;
    }

    public String getLable() {
        return lable;
    }

    public static ReceiverEnum getEnum(Integer code) {
        for (ReceiverEnum enumObj : values()) {
            if (enumObj.getCode().equals(code)) {
                return enumObj;
            }
        }
        return null;
    }
}
